<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class Benchmark::Tms - benchmark: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">Object
</div>

        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-2A">#*</a>
    <li ><a href="#method-i-2B">#+</a>
    <li ><a href="#method-i-2D">#-</a>
    <li ><a href="#method-i-2F">#/</a>
    <li ><a href="#method-i-add">#add</a>
    <li ><a href="#method-i-add-21">#add!</a>
    <li ><a href="#method-i-format">#format</a>
    <li ><a href="#method-i-memberwise">#memberwise</a>
    <li ><a href="#method-i-to_a">#to_a</a>
    <li ><a href="#method-i-to_h">#to_h</a>
    <li ><a href="#method-i-to_s">#to_s</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-Benchmark::Tms">
    <h1 id="class-Benchmark::Tms" class="class">
      class Benchmark::Tms
    </h1>

    <section class="description">
    
<p>A data object, representing the times associated with a benchmark measurement.</p>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="CAPTION">CAPTION
          <dd><p>Default caption, see also Benchmark::CAPTION</p>
          <dt id="FORMAT">FORMAT
          <dd><p>Default format string, see also Benchmark::FORMAT</p>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-cstime" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">cstime</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>System CPU time of children</p>
              </div>
            </div>
          <div id="attribute-i-cutime" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">cutime</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>User CPU time of children</p>
              </div>
            </div>
          <div id="attribute-i-label" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">label</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Label</p>
              </div>
            </div>
          <div id="attribute-i-real" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">real</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Elapsed real time</p>
              </div>
            </div>
          <div id="attribute-i-stime" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">stime</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>System CPU time</p>
              </div>
            </div>
          <div id="attribute-i-total" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">total</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>Total time, that is <code>utime</code> + <code>stime</code> + <code>cutime</code> + <code>cstime</code></p>
              </div>
            </div>
          <div id="attribute-i-utime" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">utime</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              <p>User CPU time</p>
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">(utime = 0.0, stime = 0.0, cutime = 0.0, cstime = 0.0, real = 0.0, label = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns an initialized <a href="Tms.html"><code>Tms</code></a> object which has <code>utime</code> as the user CPU time, <code>stime</code> as the system CPU time, <code>cutime</code> as the children’s user CPU time, <code>cstime</code> as the children’s system CPU time, <code>real</code> as the elapsed real time and <code>label</code> as the label.</p>

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 432</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-identifier">utime</span> = <span class="ruby-value">0.0</span>, <span class="ruby-identifier">stime</span> = <span class="ruby-value">0.0</span>, <span class="ruby-identifier">cutime</span> = <span class="ruby-value">0.0</span>, <span class="ruby-identifier">cstime</span> = <span class="ruby-value">0.0</span>, <span class="ruby-identifier">real</span> = <span class="ruby-value">0.0</span>, <span class="ruby-identifier">label</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-ivar">@utime</span>, <span class="ruby-ivar">@stime</span>, <span class="ruby-ivar">@cutime</span>, <span class="ruby-ivar">@cstime</span>, <span class="ruby-ivar">@real</span>, <span class="ruby-ivar">@label</span> = <span class="ruby-identifier">utime</span>, <span class="ruby-identifier">stime</span>, <span class="ruby-identifier">cutime</span>, <span class="ruby-identifier">cstime</span>, <span class="ruby-identifier">real</span>, <span class="ruby-identifier">label</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-ivar">@total</span> = <span class="ruby-ivar">@utime</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@stime</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cutime</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@cstime</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-2A" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">*</span><span
                                class="method-args">(x)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new <a href="Tms.html"><code>Tms</code></a> object obtained by memberwise multiplication of the individual times for this <a href="Tms.html"><code>Tms</code></a> object by <code>x</code>.</p>

                              <div class="method-source-code" id="2A-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 480</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">*</span>(<span class="ruby-identifier">x</span>); <span class="ruby-identifier">memberwise</span>(<span class="ruby-value">:*</span>, <span class="ruby-identifier">x</span>) <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-2B" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">+</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new <a href="Tms.html"><code>Tms</code></a> object obtained by memberwise summation of the individual times for this <a href="Tms.html"><code>Tms</code></a> object with those of the <code>other</code> <a href="Tms.html"><code>Tms</code></a> object. This method and #/() are useful for taking statistics.</p>

                              <div class="method-source-code" id="2B-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 467</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">+</span>(<span class="ruby-identifier">other</span>); <span class="ruby-identifier">memberwise</span>(<span class="ruby-value">:+</span>, <span class="ruby-identifier">other</span>) <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-2D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">-</span><span
                                class="method-args">(other)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new <a href="Tms.html"><code>Tms</code></a> object obtained by memberwise subtraction of the individual times for the <code>other</code> <a href="Tms.html"><code>Tms</code></a> object from those of this <a href="Tms.html"><code>Tms</code></a> object.</p>

                              <div class="method-source-code" id="2D-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 474</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">-</span>(<span class="ruby-identifier">other</span>); <span class="ruby-identifier">memberwise</span>(<span class="ruby-value">:-</span>, <span class="ruby-identifier">other</span>) <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-2F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">/</span><span
                                class="method-args">(x)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new <a href="Tms.html"><code>Tms</code></a> object obtained by memberwise division of the individual times for this <a href="Tms.html"><code>Tms</code></a> object by <code>x</code>. This method and <a href="Tms.html#method-i-2B"><code>+()</code></a> are useful for taking statistics.</p>

                              <div class="method-source-code" id="2F-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 487</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">/</span>(<span class="ruby-identifier">x</span>); <span class="ruby-identifier">memberwise</span>(<span class="ruby-value">:/</span>, <span class="ruby-identifier">x</span>) <span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add</span><span
                                class="method-args">() { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new <a href="Tms.html"><code>Tms</code></a> object whose times are the sum of the times for this <a href="Tms.html"><code>Tms</code></a> object, plus the time required to execute the code block (<code>blk</code>).</p>

                              <div class="method-source-code" id="add-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 441</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>) <span class="ruby-comment"># :yield:</span>
  <span class="ruby-keyword">self</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">measure</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add!</span><span
                                class="method-args">(&amp;blk)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>An in-place version of <a href="Tms.html#method-i-add"><code>add</code></a>. Changes the times of this <a href="Tms.html"><code>Tms</code></a> object by making it the sum of the times for this <a href="Tms.html"><code>Tms</code></a> object, plus the time required to execute the code block (<code>blk</code>).</p>

                              <div class="method-source-code" id="add-21-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 451</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add!</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
  <span class="ruby-identifier">t</span> = <span class="ruby-constant">Benchmark</span>.<span class="ruby-identifier">measure</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
  <span class="ruby-ivar">@utime</span>  = <span class="ruby-identifier">utime</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">utime</span>
  <span class="ruby-ivar">@stime</span>  = <span class="ruby-identifier">stime</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">stime</span>
  <span class="ruby-ivar">@cutime</span> = <span class="ruby-identifier">cutime</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">cutime</span>
  <span class="ruby-ivar">@cstime</span> = <span class="ruby-identifier">cstime</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">cstime</span>
  <span class="ruby-ivar">@real</span>   = <span class="ruby-identifier">real</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">real</span>
  <span class="ruby-keyword">self</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-format" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">format</span><span
                                class="method-args">(format = nil, *args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns the contents of this <a href="Tms.html"><code>Tms</code></a> object as a formatted string, according to a <code>format</code> string like that passed to Kernel.format. In addition, <a href="Tms.html#method-i-format"><code>format</code></a> accepts the following extensions:</p>
<dl class="rdoc-list note-list"><dt><code>%u</code>
<dd>
<p>Replaced by the user CPU time, as reported by <a href="Tms.html#attribute-i-utime"><code>Tms#utime</code></a>.</p>
</dd><dt><code>%y</code>
<dd>
<p>Replaced by the system CPU time, as reported by <a href="Tms.html#attribute-i-stime"><code>stime</code></a> (Mnemonic: y of “s*y*stem”)</p>
</dd><dt><code>%U</code>
<dd>
<p>Replaced by the children’s user CPU time, as reported by <a href="Tms.html#attribute-i-cutime"><code>Tms#cutime</code></a></p>
</dd><dt><code>%Y</code>
<dd>
<p>Replaced by the children’s system CPU time, as reported by <a href="Tms.html#attribute-i-cstime"><code>Tms#cstime</code></a></p>
</dd><dt><code>%t</code>
<dd>
<p>Replaced by the total CPU time, as reported by <a href="Tms.html#attribute-i-total"><code>Tms#total</code></a></p>
</dd><dt><code>%r</code>
<dd>
<p>Replaced by the elapsed real time, as reported by <a href="Tms.html#attribute-i-real"><code>Tms#real</code></a></p>
</dd><dt><code>%n</code>
<dd>
<p>Replaced by the label string, as reported by <a href="Tms.html#attribute-i-label"><code>Tms#label</code></a> (Mnemonic: n of “*n*ame”)</p>
</dd></dl>

<p>If <code>format</code> is not given, <a href="Tms.html#FORMAT"><code>FORMAT</code></a> is used as default value, detailing the user, system and real elapsed time.</p>

                              <div class="method-source-code" id="format-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 506</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">format</span>(<span class="ruby-identifier">format</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
  <span class="ruby-identifier">str</span> = (<span class="ruby-identifier">format</span> <span class="ruby-operator">||</span> <span class="ruby-constant">FORMAT</span>).<span class="ruby-identifier">dup</span>
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)n/</span>) { <span class="ruby-node">&quot;#{$1}s&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">label</span> }
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)u/</span>) { <span class="ruby-node">&quot;#{$1}f&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">utime</span> }
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)y/</span>) { <span class="ruby-node">&quot;#{$1}f&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">stime</span> }
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)U/</span>) { <span class="ruby-node">&quot;#{$1}f&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">cutime</span> }
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)Y/</span>) { <span class="ruby-node">&quot;#{$1}f&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">cstime</span> }
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)t/</span>) { <span class="ruby-node">&quot;#{$1}f&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">total</span> }
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/(%[-+.\d]*)r/</span>) { <span class="ruby-node">&quot;(#{$1}f)&quot;</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">real</span> }
  <span class="ruby-identifier">format</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">%</span> <span class="ruby-identifier">args</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">str</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_a" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_a</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new 6-element array, consisting of the label, user CPU time, system CPU time, children’s user CPU time, children’s system CPU time and elapsed real time.</p>

                              <div class="method-source-code" id="to_a-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 531</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_a</span>
  [<span class="ruby-ivar">@label</span>, <span class="ruby-ivar">@utime</span>, <span class="ruby-ivar">@stime</span>, <span class="ruby-ivar">@cutime</span>, <span class="ruby-ivar">@cstime</span>, <span class="ruby-ivar">@real</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_h" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_h</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a hash containing the same data as ‘to_a`.</p>

                              <div class="method-source-code" id="to_h-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 538</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_h</span>
  {
    <span class="ruby-value">label:</span>  <span class="ruby-ivar">@label</span>,
    <span class="ruby-value">utime:</span>  <span class="ruby-ivar">@utime</span>,
    <span class="ruby-value">stime:</span>  <span class="ruby-ivar">@stime</span>,
    <span class="ruby-value">cutime:</span> <span class="ruby-ivar">@cutime</span>,
    <span class="ruby-value">cstime:</span> <span class="ruby-ivar">@cstime</span>,
    <span class="ruby-value">real:</span>   <span class="ruby-ivar">@real</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-to_s" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">to_s</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Same as <a href="Tms.html#method-i-format"><code>format</code></a>.</p>

                              <div class="method-source-code" id="to_s-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 521</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
  <span class="ruby-identifier">format</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="protected-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Protected Instance Methods</h3>
                </header>

                  <div id="method-i-memberwise" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">memberwise</span><span
                                class="method-args">(op, x)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a new <a href="Tms.html"><code>Tms</code></a> object obtained by memberwise operation <code>op</code> of the individual times for this <a href="Tms.html"><code>Tms</code></a> object with those of the other <a href="Tms.html"><code>Tms</code></a> object (<code>x</code>).</p>

<p><code>op</code> can be a mathematical operation such as <code>+</code>, <code>-</code>, <code>*</code>, <code>/</code></p>

                              <div class="method-source-code" id="memberwise-source">
            <pre><span class="ruby-comment"># File benchmark.rb, line 559</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">memberwise</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">x</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Benchmark</span><span class="ruby-operator">::</span><span class="ruby-constant">Tms</span>
    <span class="ruby-constant">Benchmark</span><span class="ruby-operator">::</span><span class="ruby-constant">Tms</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">utime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>.<span class="ruby-identifier">utime</span>),
                       <span class="ruby-identifier">stime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>.<span class="ruby-identifier">stime</span>),
                       <span class="ruby-identifier">cutime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>.<span class="ruby-identifier">cutime</span>),
                       <span class="ruby-identifier">cstime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>.<span class="ruby-identifier">cstime</span>),
                       <span class="ruby-identifier">real</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>.<span class="ruby-identifier">real</span>)
                       )
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">Benchmark</span><span class="ruby-operator">::</span><span class="ruby-constant">Tms</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">utime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>),
                       <span class="ruby-identifier">stime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>),
                       <span class="ruby-identifier">cutime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>),
                       <span class="ruby-identifier">cstime</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>),
                       <span class="ruby-identifier">real</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">op</span>, <span class="ruby-identifier">x</span>)
                       )
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

